<template>
  <div>
      <el-button @click="add">新增</el-button>
      <List @edit="edit"></List>
      <Info ref="info" :msg="msg"></Info>
  </div>
</template>

<script>
import List from './List.vue'
import Info from './Info.vue'
export default {
    data() {
        return {
            msg: {
                isShow: false,
                name: ''
            }
        }
    },
    components: {
        List,
        Info
    },
    methods: {
        add() {
            // 打开弹窗
            this.msg.isShow = true;
            this.msg.name = 'new';
            this.$refs.info.fn1('add')
        },
        edit(val) {
            // 打开弹窗
            this.msg.isShow = true;
            this.msg.name = val;
            this.$refs.info.fn1('edit')
        }
    }
}
</script>

<style>

</style>